<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" type="text/css" href="style.css" />
		<title>项目管理系统</title>
		<script src="./jQuery/jquery-1.8.0.js"></script>
		<script src="util.js"></script>
		<script src="query.js"></script>
		<script src="insert.js"></script>
	</head>
	<body onLoad="loadBoardData()">
		<?php
			require_once("connect_sql.php");
		?>
		
	<div id="userInfo">
	</div>
	<div id="head">
		<ul id="menu">
			<li id="all"><a href="index.php" title="查看项目">查看项目</a></li>
			<li id="add"><a href="add.php" title="添加项目">添加项目</a></li>
			<li id="update"><a href="update.php" title="更新项目">更新项目</a></li>
			<li id="property"><a href="property.php" title="属性管理">属性管理</a></li>
		</ul>
	</div>
	<div id="search">
		<h1>请按条件输入需要查找的项目</h1>
		<span>主板名：</span><select id="select_board" name="board" onChange="onBoardChange(this.value)"><option value="empty">请选择主板</option></select>
		&nbsp;&nbsp;<span>客户名：</span><select id="select_customer" name="custom" onChange="onCustomChange(this.value)"><option value="empty">请选择主板</option></select>
		&nbsp;&nbsp;<span>商业名：</span><select id="select_business" name="business" onChange="onBusinessChange(this.value)"><option value="empty">请选择主板</option></select>
		&nbsp;&nbsp;<button class='button updateBtn' id="updateProject">更新项目</button>
	</div>
	<div id="project"></div>
	<div id='footbar'></div>
	</body>
	
	<!--设置标签页选中CSS-->
	<script type="text/javascript">
		var urlstr = location.href;
		var urlstatus=false;
		$("#menu a").each(function () {
			if ((urlstr + '/').indexOf($(this).attr('href')) > -1 && $(this).attr('href') != '') {
				$(this).addClass('curMenu');
				urlstatus = true;
			} else {
				$(this).removeClass('curMenu');
			}
		});
		if (!urlstatus) {
			$("#menu a").eq(0).addClass('curMenu');
		}
	</script>
	<script type="text/javascript">
		$('#userInfo').load('loadUserInfo.php', function() {
			if(getCookie('login') && getCookie('login') == 'true') {
				$('a#user').text(getCookie('nickname'));
			} else {
				location.href = 'login.html';
			}
		});
		$('#updateProject').hide();
		$('#updateProject').click(function() {
			location.href='update.php?board=' + $('#select_board').attr('value') + '&customer=' + $('#select_customer').attr('value') + '&business=' + $('#select_business').attr('value');
		});
	</script>
	<script type="text/javascript">
		function onDeleteRecordClick(id) {
			if (confirm("确定删除这项填单记录？") == true) {
				$.get("deleteWriteRecord.php?id=" + id,
					function(data, status){
						if(status == 'success' && data != '') {
							$('#record').html(trimStr(data));
						}
					});
			}
		}
	</script>
</html>